$pixel-size: 10px;

$p0: transparent;
$p1: white;
$p2: red;
$p3: #0000d1;

$ship: $p0 $p0 $p0 $p0 $p0 $p0 $p0 $p1, $p0 $p0 $p0 $p0 $p0 $p0 $p0 $p1,
  $p0 $p0 $p0 $p0 $p0 $p0 $p0 $p1, $p0 $p0 $p0 $p0 $p0 $p0 $p1 $p1 $p1,
  $p0 $p0 $p0 $p0 $p0 $p0 $p1 $p1 $p1, $p0 $p0 $p0 $p0 $p0 $p0 $p1 $p1 $p1,
  $p0 $p0 $p0 $p2 $p0 $p0 $p1 $p1 $p1 $p0 $p0 $p2,
  $p0 $p0 $p0 $p2 $p0 $p1 $p1 $p1 $p1 $p1 $p0 $p2,
  $p2 $p0 $p0 $p1 $p3 $p1 $p1 $p2 $p1 $p1 $p3 $p1 $p0 $p0 $p2,
  $p2 $p0 $p0 $p3 $p1 $p1 $p2 $p2 $p2 $p1 $p1 $p3 $p0 $p0 $p2,
  $p1 $p0 $p0 $p1 $p1 $p1 $p2 $p1 $p2 $p1 $p1 $p1 $p0 $p0 $p1,
  $p1 $p0 $p1 $p1 $p1 $p1 $p1 $p1 $p1 $p1 $p1 $p1 $p1 $p0 $p1,
  $p1 $p1 $p1 $p1 $p1 $p2 $p1 $p1 $p1 $p2 $p1 $p1 $p1 $p1 $p1,
  $p1 $p1 $p1 $p0 $p2 $p2 $p1 $p1 $p1 $p2 $p2 $p0 $p1 $p1 $p1,
  $p1 $p1 $p0 $p0 $p2 $p2 $p0 $p1 $p0 $p2 $p2 $p0 $p0 $p1 $p1,
  $p1 $p0 $p0 $p0 $p0 $p0 $p0 $p1 $p0 $p0 $p0 $p0 $p0 $p0 $p1;

@mixin pixelmatrix($art: $ship, $size: 10px) {
  display: block;
  height: $size;
  width: $size;
  $shadow: 0 0 $p0;
  @for $y from 1 through length($art) {
    @for $x from 1 through length(nth($art, $y)) {
      $shadow: $shadow +
        "," +
        calc($x * $size) +
        " " +
        calc($y * $size) +
        " " +
        nth(nth($art, $y), $x);
    }
  }
  box-shadow: unquote($shadow);
}
